package com.ag.bean;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TbTask entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TB_TASK", schema = "dbo", catalog = "AGDB")
public class TbTask implements java.io.Serializable {

	// Fields

	private String TId;
	private TbTaskStatus tbTaskStatus;
	private TbUser tbUser;
	private TbUserDept tbUserDept;
	private TbTask tbTask;
	private TbEvent tbEvent;
	private String TName;
	private String TContext;
	private Date TTime;
	private String THandeled;
	private String a;
	/**
	 * 任务分派人
	 */
	private String b;
	/**
	 * 是否上报药品的标志位
	 */
	private String c;
	private Set<TbOverRequest> tbOverRequests = new HashSet<TbOverRequest>(0);
	private Set<TbTaskFeedback> tbTaskFeedbacks = new HashSet<TbTaskFeedback>(0);
	private Set<TbTaskAnnex> tbTaskAnnexes = new HashSet<TbTaskAnnex>(0);
	private Set<TbTask> tbTasks = new HashSet<TbTask>(0);
	private Set<TbFeedbackcount> tbFeedbackcounts = new HashSet<TbFeedbackcount>(
			0);
	private Set<TbTaskResourse> tbTaskResourses = new HashSet<TbTaskResourse>(0);

//	private Set<TbMedicineConfirm> tbMedicineConfirms = new HashSet<TbMedicineConfirm>(
//			0);
	// Constructors

	/** default constructor */
	public TbTask() {
	}

	/** minimal constructor */
	public TbTask(String TId, String TName, String TContext, Date TTime) {
		this.TId = TId;
		this.TName = TName;
		this.TContext = TContext;
		this.TTime = TTime;
	}

	/** full constructor */
	public TbTask(String TId, TbTaskStatus tbTaskStatus, TbUser tbUser,
			TbUserDept tbUserDept, TbTask tbTask, TbEvent tbEvent,
			String TName, String TContext, Date TTime, String THandeled,
			String a, String b, String c, Set<TbOverRequest> tbOverRequests,
			Set<TbTaskFeedback> tbTaskFeedbacks,
			Set<TbTaskAnnex> tbTaskAnnexes, Set<TbTask> tbTasks,
			Set<TbFeedbackcount> tbFeedbackcounts,
			Set<TbTaskResourse> tbTaskResourses,
			Set<TbMedicineConfirm> tbMedicineConfirms) {
		this.TId = TId;
		this.tbTaskStatus = tbTaskStatus;
		this.tbUser = tbUser;
		this.tbUserDept = tbUserDept;
		this.tbTask = tbTask;
		this.tbEvent = tbEvent;
		this.TName = TName;
		this.TContext = TContext;
		this.TTime = TTime;
		this.THandeled = THandeled;
		this.a = a;
		this.b = b;
		this.c = c;
		this.tbOverRequests = tbOverRequests;
		this.tbTaskFeedbacks = tbTaskFeedbacks;
		this.tbTaskAnnexes = tbTaskAnnexes;
		this.tbTasks = tbTasks;
		this.tbFeedbackcounts = tbFeedbackcounts;
		this.tbTaskResourses = tbTaskResourses;
//		this.tbMedicineConfirms = tbMedicineConfirms;
	}

	// Property accessors
	@Id
	@Column(name = "T_ID", unique = true, nullable = false, length = 10)
	public String getTId() {
		return this.TId;
	}

	public void setTId(String TId) {
		this.TId = TId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TS_ID")
	public TbTaskStatus getTbTaskStatus() {
		return this.tbTaskStatus;
	}

	public void setTbTaskStatus(TbTaskStatus tbTaskStatus) {
		this.tbTaskStatus = tbTaskStatus;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "U_ID")
	public TbUser getTbUser() {
		return this.tbUser;
	}

	public void setTbUser(TbUser tbUser) {
		this.tbUser = tbUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "UD_ID")
	public TbUserDept getTbUserDept() {
		return this.tbUserDept;
	}

	public void setTbUserDept(TbUserDept tbUserDept) {
		this.tbUserDept = tbUserDept;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "T_FID")
	public TbTask getTbTask() {
		return this.tbTask;
	}

	public void setTbTask(TbTask tbTask) {
		this.tbTask = tbTask;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "E_ID")
	public TbEvent getTbEvent() {
		return this.tbEvent;
	}

	public void setTbEvent(TbEvent tbEvent) {
		this.tbEvent = tbEvent;
	}

	@Column(name = "T_NAME", nullable = false, length = 100)
	public String getTName() {
		return this.TName;
	}

	public void setTName(String TName) {
		this.TName = TName;
	}

	@Column(name = "T_CONTEXT", nullable = false, length = 1024)
	public String getTContext() {
		return this.TContext;
	}

	public void setTContext(String TContext) {
		this.TContext = TContext;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "T_TIME", nullable = false, length = 23)
	public Date getTTime() {
		return this.TTime;
	}

	public void setTTime(Date TTime) {
		this.TTime = TTime;
	}

	@Column(name = "T_HANDELED", length = 1024)
	public String getTHandeled() {
		return this.THandeled;
	}

	public void setTHandeled(String THandeled) {
		this.THandeled = THandeled;
	}

	@Column(name = "A", length = 60)
	public String getA() {
		return this.a;
	}

	public void setA(String a) {
		this.a = a;
	}

	@Column(name = "B", length = 60)
	public String getB() {
		return this.b;
	}

	public void setB(String b) {
		this.b = b;
	}

	@Column(name = "C", length = 60)
	public String getC() {
		return this.c;
	}

	public void setC(String c) {
		this.c = c;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbTask")
	public Set<TbOverRequest> getTbOverRequests() {
		return this.tbOverRequests;
	}

	public void setTbOverRequests(Set<TbOverRequest> tbOverRequests) {
		this.tbOverRequests = tbOverRequests;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbTask")
	public Set<TbTaskFeedback> getTbTaskFeedbacks() {
		return this.tbTaskFeedbacks;
	}

	public void setTbTaskFeedbacks(Set<TbTaskFeedback> tbTaskFeedbacks) {
		this.tbTaskFeedbacks = tbTaskFeedbacks;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbTask")
	public Set<TbTaskAnnex> getTbTaskAnnexes() {
		return this.tbTaskAnnexes;
	}

	public void setTbTaskAnnexes(Set<TbTaskAnnex> tbTaskAnnexes) {
		this.tbTaskAnnexes = tbTaskAnnexes;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbTask")
	public Set<TbTask> getTbTasks() {
		return this.tbTasks;
	}

	public void setTbTasks(Set<TbTask> tbTasks) {
		this.tbTasks = tbTasks;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbTask")
	public Set<TbFeedbackcount> getTbFeedbackcounts() {
		return this.tbFeedbackcounts;
	}

	public void setTbFeedbackcounts(Set<TbFeedbackcount> tbFeedbackcounts) {
		this.tbFeedbackcounts = tbFeedbackcounts;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbTask")
	public Set<TbTaskResourse> getTbTaskResourses() {
		return this.tbTaskResourses;
	}

	public void setTbTaskResourses(Set<TbTaskResourse> tbTaskResourses) {
		this.tbTaskResourses = tbTaskResourses;
	}

//	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbTask")
//	public Set<TbMedicineConfirm> getTbMedicineConfirms() {
//		return this.tbMedicineConfirms;
//	}
//
//	public void setTbMedicineConfirms(Set<TbMedicineConfirm> tbMedicineConfirms) {
//		this.tbMedicineConfirms = tbMedicineConfirms;
//	}
}